
#ifndef ERASEOPERATION_H
#define ERASEOPERATION_H

#include <BColor>
#include <BCircle>
#include <BHBoxLayout>
#include <BLabel>
#include <BSlider>
#include <BSpinBox>
#include <BEventFilter>

using namespace BWE;

class EraseOperation : public BEventFilter
{
public:
	EraseOperation();
	~EraseOperation();

protected:
	void slotRadiusSliding(BObject* object, const BValue& value);
	void slotRadiusEditFinished(BObject* object, const BValue& value);
	void slotRadiusChanged(BObject* object, const BValue& value);
	void slotColorButtonClicked();

protected:
	virtual void attached(BWidget* widget);
	virtual void detached(BWidget* widget);

	virtual void paint(BPainter& painter);
	virtual void updateEvent(const BEvent& event);

	virtual void freshEvent(const BEvent& event);
	virtual void focusEvent(const BEvent& event);
	virtual void keyPressEvent(const BKeyEvent& keyEvent);
	virtual void keyReleaseEvent(const BKeyEvent& keyEvent);

	virtual void mouseEnterEvent(const BMouseEvent& mouseEvent);
	virtual void mouseLeaveEvent(const BMouseEvent& mouseEvent);
	virtual void mousePressEvent(const BMouseEvent& mouseEvent);
	virtual void mouseReleaseEvent(const BMouseEvent& mouseEvent);
	virtual void mouseMoveEvent(const BMouseEvent& mouseEvent);

private:
	BHolder<BHBoxLayout>	_layout;
	BLabel*					_eraseLabel;
	BSlider*				_sizeSlider;
	BSpinBox*				_sizeSpinBox;
	BButton*				_colorButton;

	bool				_pressed;
	BPoint				_eraseCenter;
};

#endif
